/*include:js\fileClicker*/
var Upload=	{
Query:{},
Load:function()
	{
	this.FileClicker=fastCSharp.GetFileClicker('upFileButton');
	this.IsUploading=0;
	fastCSharp.$(document.body).Display(1);
	var Parent=parent.document.getElementsByName(name)[0],Button=fastCSharp.$Id('upFileButton');
	if(fastCSharp.Query.button)	Button.Html(fastCSharp.Query.button.ToHTML());
	Parent.style.width=Button.Width()+'px';
	Parent.style.height=Button.Height()+'px';
	if(fastCSharp.Query.onLoad)	eval(fastCSharp.Query.onLoad)(this);
	for(var Name in fastCSharp.Query)
		{
		if(Name!='type'&&Name!='onLoad'&&Name!='button')
			{
			var Value=fastCSharp.Query[Name];
			if(Value!=null&&typeof(Value)!='function')	this.Query[Name]=Name=='button'?unescape(Name):Value;
			}
		}
	},
Change:function()
	{
	if(fastCSharp.Query.onChange)	eval(fastCSharp.Query.onChange)(this.FileClicker,fastCSharp.$Value('upFile'));
	else	this.Post();
	},
Post:function()
	{
	if(fastCSharp.$Value('upFile')&&this.IsUploading==0)
		{
		this.IsUploading=1;
		fastCSharp.$Id('__JSON__').Value(fastCSharp.ToJson(this.Query));
		fastCSharp.$(fastCSharp.$Id('upFile').Display(0).Element().form).Set('action','/upload/'+(this.UploadType||fastCSharp.Query.type)).Element().submit();
		}
	}
		};
fastCSharp.OnLoad(Upload.Load,Upload);
